home *** CD-ROM | disk | FTP | other *** search
- Path: news.ios.com!usenet
- From: Keith Boruff <kboruff@village.ios.com>
- Newsgroups: comp.lang.c++
- Subject: what is the proper way to create header files??
- Date: 10 Jan 1996 01:59:31 GMT
- Organization: Internet Online Services
- Message-ID: <4cv6i3$9dg@news.ios.com>
- NNTP-Posting-Host: ppp-61.ts-2.nyc.idt.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1PE (Windows; I; 16bit)
-
- I have spent some time scanning the included header files that came with
- my compiler (iostream.h, math.h, cstring.h, etc...).
-
- I have noticed that any functions that can be used from a given header
- file has only its prototype (declaration) listed. The definitions in most
- cases are not to be found in the header files themselves.
-
- I had learned some time ago about creating library files. I heard that a
- library should contain an interface (header file) and and implementation
- file. The header file contains all info pertaining to function
- declarations and class declarations. The implementation files contain the
- definitions of any functions. The implementation file is compiled
- separately and then linked to any source file that includes the
- interface. exam: #include "somefile.h"..
-
- This is sure the case with all files in my include directory. I cannot
- figure out how including a header file with function declarations will
- automatically include the binary file with its corresponding definitions.
-
- The only way that I can achieve a similiar outcome is by linking my
- driver file and header binary file together in a project. Yet I do not
- have to do this with say: iostream.h, cstring.h, ctype.h...ad nauseum..
-
- I would like to be able to do this so that I can hide the ugly details of
- any function definitions and only expose the programmer to what my
- classes, functions offer.
-
- Could someone tell me how this is achieved? I want to be able to include
- my own header files into my driver files without the inconvenience of
- linking two separate files in a project.
-
- Does this method take some extensive knowledge in knowing preprocessor
- directives. I have seen these things smeared all over the *.h text files.
- Any help on this matter would be greatly appreciated.
-
- Keith Boruff
-
-